import type { RouteRecordRaw } from 'vue-router'

import LayoutMain from "@/components/head/LayoutMain.vue"
// export const LayoutMain=()=>import("@/components/head/LayoutMain.vue")

// export const Layout = () => import("@/layout/index.vue");
/**
 * 路由配置
 * @description 所有路由都在这里集中管理
 */
const constantRoutes: RouteRecordRaw[] = [
  // const constantRoutes = [
  /**
   * 首页
   */
  {
    path: '/',
    component: LayoutMain,
    name: 'home',
    children: [
      {
        path: '/',
        component: () => import('@/views/home.vue'),
      }
    ],
    meta: {
      title: '地方到',
    },
  },
  // {
  //   path: "/medicine",
  //   component: LayoutMain,
  //   meta: {
  //     requiresAuth: true,
  //     title: 'Foo',
  //   },
  //   children: [
  //     {
  //       path: "/medicine",
  //       component: () => import("@/views/medicines/index.vue"),
  //     },
  //   ],
  // },
  // {
  //   path: "/user",
  //   component: LayoutMain,
  //   meta: {
  //     requiresAuth: true,
  //     title: 'user',
  //   },
  //   children: [
  //     {
  //       path: "/user",
  //       component: () => import("@/views/user/index.vue"),
  //     },
  //   ],
  // },
  /**
   * 登录页面
   */
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: 'login',
    },
  },
  /**
   * 子路由示例
   */
  {
    path: '/foo',
    name: 'foo',
    // component: () => import('@/components/TransferStation.vue'),
    component: LayoutMain,
    meta: {
      requiresAuth: true,
      title: 'Foo',
    },
    redirect: {
      name: '/fbar',
    },
    children: [
      {
        path: '/fbar',
        name: 'bar',
        component: () => import('@/views/foo/bar.vue'),
        meta: {
          requiresAuth: true,
          title: 'Bar',
        },
      },
    ],
  },
]

export default constantRoutes
